import i18n from '@/i18n'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { MetaResourceModuleActionType } from '@prisma/client'
import { MetaResourceModule } from './meta-resource-module'

export class MetaResourceModuleAction {
  static ApiPropertyEnum = {
    MetaResourceModuleActionType: [
      i18n.t('app-meta.model.meta-resource-module-action.1215085-0', { args: [MetaResourceModuleActionType.GetPage] }),
      i18n.t('app-meta.model.meta-resource-module-action.1215085-1', { args: [MetaResourceModuleActionType.GetList] }),
      i18n.t('app-meta.model.meta-resource-module-action.1215085-2', {
        args: [MetaResourceModuleActionType.GetDetail],
      }),
      i18n.t('app-meta.model.meta-resource-module-action.1215085-3', { args: [MetaResourceModuleActionType.PostForm] }),
      i18n.t('app-meta.model.meta-resource-module-action.1215085-4', { args: [MetaResourceModuleActionType.Delete] }),
    ],
  }

  @ApiProperty({ description: 'ID', type: Number })
  id: number

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-5'), type: Number })
  resourceModuleId: number

  @ApiPropertyOptional({
    description: i18n.t('app-meta.model.meta-resource-module-action.1215085-6'),
    type: () => MetaResourceModule,
  })
  resourceModule?: MetaResourceModule

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-7'), type: String })
  resourceModuleName: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-8'), type: String })
  name: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-9'), type: String })
  label: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-10'), type: Date })
  createTime: Date

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-11'), type: String })
  platform: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-resource-module-action.1215085-12'), type: String })
  project?: string

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-resource-module-action.1215085-13'),
    enum: MetaResourceModuleAction.ApiPropertyEnum.MetaResourceModuleActionType,
  })
  actionType: MetaResourceModuleActionType
}
